{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python \t\t3.6\n",
      "Tensorflow \t1.0.0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Keras \t\t2.0.3\n"
     ]
    }
   ],
   "source": [
    "import sys; print('Python \\t\\t{0[0]}.{0[1]}'.format(sys.version_info))\n",
    "import tensorflow as tf; print('Tensorflow \\t{}'.format(tf.__version__))\n",
    "import keras; print('Keras \\t\\t{}'.format(keras.__version__))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline \n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting ../mnist-data/train-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/train-labels-idx1-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-labels-idx1-ubyte.gz\n"
     ]
    }
   ],
   "source": [
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "mnist = input_data.read_data_sets(\"../mnist-data/\", one_hot=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(55000, 784)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnist.train.images.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAABpCAYAAABLV9A4A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G+\n709/+hMAzrnKDkxEas5dd90FwOjRo33fpEmTANhxxx2rMiYRadp3330HwI033uj7Xnklt+bBs88+\n69vbb7903962bdv6Pnvet2nTxvd16NAh7mBbmbvvXlok8NJLL/V9VtxN2Uo5rLfeejl977zzThVG\nUhzNqImIiIiIiKSMDtRERERERERSpsUtfbz88st9e6WVVgJgzJgxvm+FFVrcXa66N954A4ARI0b4\nvrffftu3bfnJxx9/7PvuvfdeAM477zzf16lTp7KOU6S57rjjDgDmzp3r++xxPnv27KqMSaS1C09x\nWLhwIQB/+ctffN9hhx0GwNChQ5u8nh122MG3J06cCEBdXZ3vmzZtGgCzZs3yfccddxwAxx9/vO+z\nzxqS3zPPPOPbw4YNA2CfffbxfSuuuGKlhyStyLx58wBYd911qzyS4mhGTUREREREJGVa3PSSFQsB\nOOqoo4Dsb8gkjldffdW3Bw0aBGSfnJkkiW8PGDAAgI022sj32WzEzJkzfd/DDz8MQMeOHcsw4vSy\nb4TXXHNN32czv4sXL/Z9H3zwQc7vPv7447793HPPNXobV111lW+vvfbaOZf/+c9/BmC//fYrdNit\nwvTp06s9hKr47LPPAPjDH/7g+8IZi6b8+Mc/9u2LL74YgPXXXz/i6KQ1+fzzz33b3jfOPPNM3zd5\n8uSc37nkkksA6Nu3r++zWba33nrL92222Wa+bbNrW265pe974oknADj88MN9n82yLViwwPddcMEF\ngGbWlnXfffcBcMUVV/i+//znPwCstdZavq+15vbRRx8Bmc8+AOPGjQOyt5AK/fa3vwVg/PjxZR5d\nbbMCNZB5btvztDnComFWoND+BpWiGTUREREREZGU0YGaiIiIiIhIyrSYpY92cvHXX3/t+3r27Fmt\n4bRYJ554IgCPPvqo77Mlj127dvV94TK+F198EYAjjzzS99mJ23YZwI9+9CMgs7QEYOWVV4429mqx\n+wrZSxzMY489BmRPsdtSEFsaEf5cKFxi2tTegOHPvfnmmzmX2xKftC99vPXWWwG4+eabfd9ZZ50F\nQK9evSoyBltC1dI89dRTvj1y5EgAXnvtNd+X7/G10047AfD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oVSbLkoLK2m1BjbGw1gn332AbC14TlseWh4Yvzll19e/GDzSGOm5WTFgsJlz2HR\nghhaW6aFsiW6TT0/mpIn117OucG0klz32GOP6NdZjUw7dOjg22effTaQWRIfOvHETP0CWwYZFqGy\nolhhAbCLL74YgB133NH3hUUECl0mHr6eN9eymb7xxhuk8XFqS5DDPezs72GFKyCzNN/er6qhtb2m\nWhGmr776yveFf5MYWkOm8+bNy2mntahIIVUfnwIaK3kW/92hFejXr19OxTPn3KdJknyEMi2KMo1P\nmcanTMtj2Vydc7OTJLFvgZRrEZRpfMtm2qdPH2bMmKFMS6DX1PiUaboU9/WltFjhSen2rWV40qqV\nLp4/f77vs4ILYeGL8Elu31RaoRaAX//610Bps2hpN3bsWACeffZZ3zdgwAAAFixY4Pvsm+B7773X\n933xxRdAdll4m7mETGGWfv36xR52q7fLLrv49qOPPgpkzyBLfEuWLAHgu+8y56vHKNjUUoQFMJ54\n4gkANt10U99X6nYpadGmTRvftvef8D3i7bffBjLbuwBssMEGOT9n70XhY2jFFVcsw4hbJsvK3sMg\n8xgMi6hUcyatNendu7dvT5s2rYojqW077LCDb4efYdNO74QiIiIiIiIpowM1ERERERGRlNHSR2lU\nx44dAZgwYYLvs7YtvwFs086swgvhMkc7GTU8ibs12GSTTYDs5SO2ZCdc0pjPyiuvDGTvaxdeTyl7\nzUnThg0blrctcay11lo5fVOnTgWy9wvacMMNKzWk1Hv55Zd924oIhEsfiy3Ckma2DHLQoEE5lx19\n9NGVHk6rd9FFF1V7CK1W+Fw39vkMYP3116/kcGrW008/Xe0hFEUzaiIiIiIiIinT8r6Gk4ro379/\nTt/AgQOrMJL0uuyyy4BMqWOAe+65B8guu28zb4MHD/Z9Y8aMAaCurq7cwxSpqAsvvBCA+vp639ej\nRw8gveWRq+2FF17I6cs30yQiLc/BBx/s29dccw0AZ511lu/beOONKz4mqRzNqImIiIiIiKSMDtRE\nRERERERSRksfRcqkXbt2AJx++um+L2yLtEYdOnQAMnvUSfNYkZWRI0d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y+ac84B1wCvJklyQXDR3cDQ\nhvZQ4B8VHpoyjU+ZxlezmUJqc1Wm8SnT+JRpfMq0PGo2V2UaX6oyjVWVpJD/gMEsrZwyBzilkrdd\n4rj7sXR680XghYb/BgNrAo8AbwIPA2tUYWzKVJkq01aYqzJVpspUmSpT5apMW3amrmFAIiIiIiIi\nkhIqJiIiIiIiIpIyOlATERERERFJGR2oiYiIiIiIpIwO1ERERERERFJGB2oiIiIiIiIpowM1ERER\nERGRlNGBmoiIiIiISMr8PzT+1wrcrWcKAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x117fa3668>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(15,5))\n",
    "for i in list(range(10)):\n",
    "    plt.subplot(1, 10, i+1)\n",
    "    pixels = mnist.test.images[i+100]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import tensorlayer as tl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Set parameters\n",
    "n_epoch = 5\n",
    "batch_size = 250\n",
    "print_freq = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# TF graph input\n",
    "x = tf.placeholder('float', [None, 784]) # mnist data image of shape 28*28=784\n",
    "y = tf.placeholder('float', [None,10]) # 0-9 digits recognition => 10 classes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [TL] InputLayer  input_layer: (?, 784)\n",
      "  [TL] ReshapeLayer reshape_layer: (?, 28, 28, 1)\n",
      "  [TL] Conv2dLayer cnn_32_1: shape:[3, 3, 1, 32] strides:[1, 1, 1, 1] pad:SAME act:relu\n",
      "  [TL] Conv2dLayer cnn_32_2: shape:[3, 3, 32, 32] strides:[1, 1, 1, 1] pad:SAME act:relu\n",
      "  [TL] PoolLayer   cnn_maxpool_1: ksize:[1, 2, 2, 1] strides:[1, 2, 2, 1] padding:SAME pool:max_pool\n",
      "  [TL] Conv2dLayer cnn_64_1: shape:[3, 3, 32, 64] strides:[1, 1, 1, 1] pad:SAME act:relu\n",
      "  [TL] Conv2dLayer cnn_64_2: shape:[3, 3, 64, 64] strides:[1, 1, 1, 1] pad:SAME act:relu\n",
      "  [TL] PoolLayer   cnn_maxpool_2: ksize:[1, 2, 2, 1] strides:[1, 2, 2, 1] padding:SAME pool:max_pool\n",
      "  [TL] FlattenLayer flatten: 3136\n",
      "  [TL] DropoutLayer drop1: keep:0.750000 is_fix:False\n",
      "  [TL] DenseLayer  relu1: 256 relu\n",
      "  [TL] DropoutLayer drop2: keep:0.750000 is_fix:False\n",
      "  [TL] DenseLayer  output_layer: 10 identity\n"
     ]
    }
   ],
   "source": [
    "network = tl.layers.InputLayer(x, name='input_layer')\n",
    "network = tl.layers.ReshapeLayer(network, [-1, 28, 28, 1])\n",
    "\n",
    "network = tl.layers.Conv2dLayer(network,act = tf.nn.relu,shape = [3, 3, 1, 32],  name ='cnn_32_1')\n",
    "network = tl.layers.Conv2dLayer(network,act = tf.nn.relu,shape = [3, 3, 32, 32], name ='cnn_32_2')\n",
    "network = tl.layers.MaxPool2d(network, (2,2), name='cnn_maxpool_1')\n",
    "        \n",
    "network = tl.layers.Conv2dLayer(network,act = tf.nn.relu,shape = [3, 3, 32, 64], name ='cnn_64_1')\n",
    "network = tl.layers.Conv2dLayer(network,act = tf.nn.relu,shape = [3, 3, 64, 64], name ='cnn_64_2')\n",
    "network = tl.layers.MaxPool2d(network, (2,2), name='cnn_maxpool_2')\n",
    "\n",
    "network = tl.layers.FlattenLayer(network, name='flatten')\n",
    "\n",
    "network = tl.layers.DropoutLayer(network, keep=0.75, name='drop1')\n",
    "network = tl.layers.DenseLayer(network, n_units=256,act = tf.nn.relu, name='relu1')\n",
    "network = tl.layers.DropoutLayer(network, keep=0.75, name='drop2')\n",
    "network = tl.layers.DenseLayer(network, n_units=10, name='output_layer')\n",
    "\n",
    "y_hat = network.outputs\n",
    "y_out  = tf.nn.softmax(network.outputs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,logits=y_hat))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_params = network.all_params\n",
    "with tf.name_scope(\"train\") as scope:\n",
    "    # Gradient descent\n",
    "    optimizer = tf.train.AdamOptimizer()\n",
    "    learn     = optimizer.minimize(cost, var_list=train_params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Test the model, Calculate accuracy\n",
    "predictions = tf.equal(tf.argmax(y_out, 1), tf.argmax(y, 1))\n",
    "acc = tf.reduce_mean(tf.cast(predictions, \"float\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Initializing the variables\n",
    "init = tf.global_variables_initializer()\n",
    "\n",
    "# Merge all summaries into a single operator\n",
    "merged_summary_op = tf.summary.merge_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Launch the graph\n",
    "sess = tf.InteractiveSession()\n",
    "\n",
    "# Logs and graph for tensorboard\n",
    "summary_writer = tf.summary.FileWriter('./tensorboard/tensorlayer', graph=sess.graph)\n",
    "\n",
    "# Init the session\n",
    "sess.run(init)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Start training the network ...\n",
      "Epoch 1 of 5 took 170.754563s\n",
      "   val loss: 0.069441\n",
      "   val acc: 0.975700\n",
      "Epoch 2 of 5 took 156.410212s\n",
      "   val loss: 0.045561\n",
      "   val acc: 0.984800\n",
      "Epoch 3 of 5 took 164.174852s\n",
      "   val loss: 0.032850\n",
      "   val acc: 0.988800\n",
      "Epoch 4 of 5 took 157.983728s\n",
      "   val loss: 0.032882\n",
      "   val acc: 0.988100\n",
      "Epoch 5 of 5 took 159.763808s\n",
      "   val loss: 0.025896\n",
      "   val acc: 0.991300\n",
      "Total training time: 863.797987s\n"
     ]
    }
   ],
   "source": [
    "# train the network\n",
    "tl.utils.fit(sess, network, learn, cost, mnist.train.images, mnist.train.labels, x, y,\n",
    "             acc=acc, batch_size=batch_size, n_epoch=n_epoch, print_freq=print_freq, \n",
    "             X_val=mnist.test.images, y_val=mnist.test.labels, eval_train=False)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Start testing the network ...\n",
      "   test acc: 0.991300\n"
     ]
    }
   ],
   "source": [
    "# evaluation\n",
    "tl.utils.test(sess, network, acc, mnist.test.images, mnist.test.labels, x, y, batch_size=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{<tf.Tensor 'Placeholder_2:0' shape=<unknown> dtype=float32>: 1,\n",
       " <tf.Tensor 'Placeholder_3:0' shape=<unknown> dtype=float32>: 1}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dp_dict = tl.utils.dict_to_one( network.all_drop )\n",
    "dp_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 8.1228354e-06,\n",
       " 1: 1.3522767e-08,\n",
       " 2: 8.6567997e-09,\n",
       " 3: 6.3256472e-10,\n",
       " 4: 1.2988748e-07,\n",
       " 5: 1.2763636e-06,\n",
       " 6: 0.99999011,\n",
       " 7: 7.4560502e-10,\n",
       " 8: 3.5295832e-07,\n",
       " 9: 2.9802494e-10}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# test item #100 is a \"six\"\n",
    "pixels = mnist.test.images[100]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "\n",
    "result = sess.run(y_out, feed_dict=feed_dict)\n",
    "dict(zip(range(10), result[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def test_render(pixels, result, truth):\n",
    "    #pixels, result and truth are np vectors\n",
    "    plt.figure(figsize=(10,5))\n",
    "    plt.subplot(1, 2, 1)\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "\n",
    "    plt.subplot(1, 2, 2)\n",
    "    \n",
    "    #index, witdh\n",
    "    ind = np.arange(len(result))\n",
    "    width = 0.4\n",
    "\n",
    "    plt.barh(ind,result, width, color='gray')\n",
    "    plt.barh(ind+width,truth,width, color='green')\n",
    "    plt.yticks(ind+width, range(10))\n",
    "    plt.margins(y=0)\n",
    "\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGdBJREFUeJzt3X2QXXV9x/HPxwSIPMiDbEOApAuIDimFQO+kWJSioEMQ\nCRbHIaOCNsP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bkeR/L+SdJIk2T5C7TI12NWUaRZLOjs7q+84SU+k\nXqSY3XwAkImIzbbPl3SrXrw7wwrb/yipPyIWq307nq/ZflDtg1zPKi/xSxXM/y+S9pT07ey4+V9F\nxOmlhR6m4M9QWQXz3yrpzbbvl7RF0t9GRCW2bhbMf7Gkq2x/WO2D0d9ToX9QvOSOGtlxXfMk7SJJ\nEfFvah/ndaqkByX9TtJ7kz+zQj8/AABA7bCbDwAAIAFlCgAAIAFlCgAAIAFlCgAAIAFlCgAAIAFl\nCgAAIAFlCgAAIMH/A1Ouclco6Q7eAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11ace6b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "i = random.randint(0,mnist.test.images.shape[0])\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "### What went wrong?\n",
    "pixels = mnist.test.images\n",
    "truth = mnist.test.labels\n",
    "\n",
    "feed_dict = {x:pixels}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Incorrect predictions: 87\n"
     ]
    }
   ],
   "source": [
    "acc = result.argmax(axis=1) == truth.argmax(axis=1)\n",
    "incorrect = np.argwhere(acc==False).flatten()\n",
    "\n",
    "print(\"Incorrect predictions: {}\".format(len(incorrect)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
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5xjk0+\nxyXOscnnuMQ5NvkclzjHJp/jEufY5HNc8jkucdWMTb0uAs0H1sj8f/WO+wonSZKlWBL8W9I0/QVA\nmqavp2n6Tpqm7wJXsyTtrFItERvHJc6xyee4xDk2+RyXOMcmn+MS59jkc1ziHJt8jkucY5PPcclX\ng7iAY5OrXheBHgPWS5JknSRJBgKfA+6u02tXTZIkCXANMDNN0/Mz9w/NPGx/YEYvnrbwsXFc4hyb\nfI5LnGOTz3GJc2zyOS5xjk0+xyXOscnnuMQ5Nvkcl3w1igs4NrkGVG/z4tI0/V+SJCcA97GkQve1\naZo+U4/XrrLtgcOAp5Mkmd5x38nAwUmSDAdSYC5wXKVP2CKxcVziHJt8jkucY5PPcYlzbPI5LnGO\nTT7HJc6xyee4xDk2+RyXfFWPCzg2MUm6pNWYmZmZmZmZmZm1MBeGNjMzMzMzMzNrA74IZGZmZmZm\nZmbWBnwRyMzMzMzMzMysDfgikJmZmZmZmZlZG/BFIDMzMzMzMzOzNuCLQGZmZmZmZmZmbcAXgczM\nzMzMzMzM2oAvApmZmZmZmZmZtYH/B6NwhzUvlIcRAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x123f75630>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(20,5))\n",
    "plt_idx = 1\n",
    "for i in list(incorrect[:16]):\n",
    "    plt.subplot(1, 16, plt_idx)\n",
    "    pixels = mnist.test.images[i]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "    plt_idx += 1\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG2FJREFUeJzt3X2QXXWd5/HPxwSW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xRM/Ml3VDcvk3S8cVZknWQzB8RSyPid8XdR9XamqZOyvwzkKT/olaR/UMnw5VQJv/5kq7Z\nsjFusd1OXZTJH5J2K27vLmmog/mSIuJBSVs76We+pP8ZLY9Ket+oM5onjDIFAO8Y6+oM+4w3ExGb\nJL0i6f0dSZdWJv9I50m6Z1ITTVzydyg+ltkvIv53J4OVVOafwZ9K+lPbP7X9qO2tHUXptDL5r5D0\nWdtrJd0t6S87E61tJvrvSVJVl5MBAFTI9mcl9Uk6puosE2H7PZK+JumciqPkmKrWR0zHqnVk8EHb\nH4yIlytNVd4ZkhZHxFeLa+3+re1Dik1/uxJHpgDgHWWuzvD2jO2pan3M8f86ki6t1NUlbH9M0hcl\nzYuIf+pQtrJSv8Oukg6R9KPi4vNHSFpSo0XoZf4ZrJW0JCLejIh/lPSsWuWqDsrkP0+tvfQUEY9I\n2kmtPQKbou1XYaFMAcA7ylydYeQO938u6R+iPhv2JfPbPlTStWoVqTqt1dliq79DRLwSEdMiYkZE\nzFBr3de8iBisJu4fKfN36O/VOiol29PU+thvTSdDbkWZ/L+SdLwk2T5YrTI13NGUeZZIOqs4q+8I\nSa/kblLMx3wAUIiITbYvknSf3rk6w0rb/1nSYEQsUetyPH9re7Vai1wXVJf43Urmv0rSeyX9XbFu\n/lcRMa+y0KOU/B1qq2T++ySdYPspSZsl/YeIqMXRzZL5L5X0Hdt/pdZi9HNq9D8U77qiRrGua0DS\nDpIUEf9drXVeJ0laLel3kv4i+zVr9PsDAAA0Dh/zAQAAZKBMAQAAZKBMAQAAZKBMAQAAZKBMAQAA\nZKBMAQAAZKBMAQAAZPj/9/z/U9XMrt0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x123f75c50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "i = random.choice(list(incorrect))\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Close the Session when we're done.\n",
    "sess.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
